<div class="quote round">
  <div class="quote_header">
    <table class="quote_timestamps form">
      <tr>
        <td class="label">Submitted:</td>
        <td>{{ quote.formattedSubmitted|escape }}</td>
      </tr>
{% if quote.modified %}
{%   ifnotequal quote.submitted quote.modified %}
      <tr>
        <td class="label">Modified:</td>
        <td>{{ quote.formattedModified|escape }}</td>
      </tr>
{%   endifnotequal %}
{% endif %}
    </table>
    <div class="quote_by">
      Quote by
{% if quote.owner_page %}
      <a href="/browse?page={{ quote.owner_page.encode|urlencode }}">{{ quote.parent.name|escape }}</a>
{% else %}
      {{ quote.parent.name|escape }}
{% endif %}
{% if account.admin %}
      [{{ quote.key.id }}]
{%   if quote.clone_of %}
      / [{{ quote.clone_of.key.id }}]
{%   endif %}
{% endif %}
    </div>
{% if quote.getLabelDict.network or quote.getLabelDict.server or quote.getLabelDict.channel %}
    <div class="quote_location">
{%   if quote.getLabelDict.network %}
      <b>Network:</b>
      <a href="/browse?page=m=label&l=network:{{ quote.getLabelDict.network|urlencode}}">{{quote.getLabelDict.network}}</a>
{%   endif %}
{%   if quote.getLabelDict.server %}
      <b>Server:</b>
      <a href="/browse?page=m=label&l=server:{{ quote.getLabelDict.server|urlencode}}">{{quote.getLabelDict.server}}</a>
{%   endif %}
{%   if quote.getLabelDict.channel %}
      <b>Channel:</b>
      <a href="/browse?page=m=label&l=channel:{{ quote.getLabelDict.channel|urlencode}}">{{quote.getLabelDict.channel}}</a>
{%   endif %}
    </div>
{% endif %}
{% if not preview and account.trusted %}
    <div class="nav quote_options">
      <span class="quote_options_control">Options &#9662;</span>
      <div class="quote_options_menu menu" style="display: none">
{%   ifequal account.key quote.parent_key %}
{%     ifequal quote.state quote.DRAFT %}
        <a href="/edit-draft?key={{ quote.key|urlencode }}">Edit</a>
{%     else %}
{%       if quote.clone_of %}
        <a href="/edit?key={{ quote.clone_of|urlencode }}">Edit</a>
{%       else %}
        <a href="/edit?key={{ quote.key|urlencode }}">Edit</a>
{%       endif %}
{%     endifequal %}
        <a href="/delete?key={{ quote.key|urlencode }}&return_url={{ delete_return_url|urlencode }}">Delete</a>
{%   endifequal %}
{%   if account.admin %}
        <a href="/quote?key={{ quote.key|urlencode }}&rebuild=1">Rebuild</a>
{%   endif %}
      </div>
    </div>
{% endif %}
{% if quote.getLabelDict.other %}
    <div class="quote_labels">
      <b>Labels:</b>
{%   for label in quote.getLabelDict.other_list %}
      <a href="/browse?page=m=label&l={{ label|urlencode }}">{{ label|escape }}</a>{% if not forloop.last %},{% endif %}
{%   endfor %}
    </div>
{% endif %}
    <div style="clear: right; height: 0">&nbsp;</div>
  </div>
  <table class="quote_source" cellspacing="0">
{% for line in quote.getDialog %}
    <tr class="{% cycle row0,row1 %}">
      <td>
{%   if line.params.timestamp %}
        {{ line.params.timestamp }}
{%   else %}
        &nbsp;
{%   endif %}
      </td>
      <td class="actor">
{%   if line.params.nick %}
        &lt;{% if line.params.nickflag %}{{ line.params.nickflag|escape }}{% endif %}<a href="/browse?page=m=label&l=nick:{{ line.params.nick.lower|urlencode }}">{{ line.params.nick|escape }}</a>&gt;
{%   else %}
        &nbsp;
{%   endif %}
      </td>
      <td class="text">{{ line.text|escape }}</td>
    </tr>
{% endfor %}
  </table>
  <div class="quote_footer">
{% if account.trusted %}
    <table class="rating_container" key="{{ quote.key|escape }}" count="{{ quote.rating_count }}" total="{{ quote.rating_total }}"{% if quote.account_rating %} personal="{{ quote.account_rating }}"{% endif %} chart="{{ quote.ratingBucketChart|escape }}">
    </table>
{% endif %}
{% if quote.note %}
    <div class="quote_note">
      <span class="label">Note:</span>{{ quote.note }}
    </div>
{% endif %}
    Link to this quote:
    <a href="/q/{{ quote.parent_key.id }}/{{ quote.key.id }}">{{ request.application_url|escape }}/q/{{ quote.parent_key.id }}/{{ quote.key.id }}</a>
    <div style="clear: both; height: 0">&nbsp;</div>
  </div>
</div>
